package com.gqzmy.springboot3.config;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author 周小哥  gqzmy@163.com 2023/4/24 14:48
 */

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface MybatisId {

    IdType type() default IdType.ID_TYPE_UUID;

    enum IdType {

        ID_TYPE_UUID("1", "默认采用UUID"),
        ID_TYPE_AUTO_INCREMENT("2", "数据库自动生成"),
        ID_TYPE_CUSTOM("3", "自定义生成id方式,全局唯一");

        final String type;

        final String message;

        IdType(String type, String message) {
            this.type = type;
            this.message = message;
        }
    }

}
